//
//  NewsTableViewCell.m
//  Movie
//
//  Created by mycomputer on 15/7/21.
//  Copyright (c) 2015年 杨韦智. All rights reserved.
//

#import "NewsTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation NewsTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setModel:(NewsModel *)model {
    _model = model;
    [self setNeedsLayout];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    [_newsImageView sd_setImageWithURL:[NSURL URLWithString:_model.image]];
    _titleLabel.text = _model.title;
    _summaryLabel.text = _model.summary;
    if (_model.type == 0) {
        _typeImageView.image = [UIImage imageNamed:nil];
    }
}

@end
